declare function
unescape(key: any);
class SystemManger {
  public static getStateWidth(): number {
    return 1920;
  }
  public static getStateHeight(): number {
    return 1080;
  }

  public static getCookie(key: any) {
    if (document.cookie.length > 0) {
      var c_start = document.cookie.indexOf(key + "=")
      if (c_start != -1) {
        c_start = c_start + key.length + 1
        var c_end = document.cookie.indexOf(";", c_start)
        if (c_end == -1) c_end = document.cookie.length
        return unescape(document.cookie.substring(c_start, c_end))
      }
    }
    return false;
  }

  public static setCookie(key: any, value: any) {
    var expiredays = 2;
    var exdate = new Date()
    exdate.setDate(exdate.getDate() + expiredays)
    var the_cookie = key + "=" + value + ";"; //编写cookie的键与值
    the_cookie += ((expiredays == null) ? "" : ";expires=" + exdate.toString());
    the_cookie = the_cookie + "path=/;"; //设置cookie的路径
    the_cookie = the_cookie + "domain=" + document.domain + ";"; //设置cookie的域
    document.cookie = the_cookie; //将这些信息写入cookie变量中去
  }
  public static RESURL = "resource/";
}